package com.test.google.app.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	
	public static final String FORMAT = "yyyy-MM-dd HH:mm:ss";
	
	public static String dateTimeToString(Date date) {
		return new SimpleDateFormat(FORMAT).format(date);
	}
	
	public static Date toDateTime(String dateStr) {
		try {
			return new SimpleDateFormat(FORMAT).parse(dateStr);
		} catch (ParseException e) {
			throw new RuntimeException(e);
		}
	}
	
}
